﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace GameJamKingdom
{
    class WaterBlock:GridObject
    {
        Texture2D emptyTex;
        float resistance;

        public WaterBlock(Game1 cGame)
        {
            type = "water";
            maxPerColumn = 7;
            emptyTex = cGame.Content.Load<Texture2D>("waterTile");
            resistance = 200; // ms on average of slowdown
        }

        public override void update(GameTime cTime)
        {

        }

        public override void render(Rectangle cRect, SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(emptyTex, cRect, Color.White);
        }

        public override bool testTime(Mode cMode, int lastTime)
        {
            if (lastTime > resistance + 200 - cMode.speed || (cMode.type.Equals("flipper") && lastTime > 200 - cMode.speed))
                return true;
            else
                return false;
        }
    }
}
